import React from 'react';
import { Button, Checkbox } from 'antd';
import classnames from 'classnames';
import './index.less';

function Item (props) {
    const { itemData, index, stateChange } = props;
    console.log(itemData);

    function onChange(type) {
        stateChange(index, type);
    }
    
    return (
        // <div className={classnames('todo-list-item', {'todo-list-delete': itemData.statue == 0})}>
        <div className={`todo-list-item ${itemData.statue == 0 ? 'todo-list-delete' : null}`}>
            <Checkbox onChange={() => onChange('done')}>{itemData.value}</Checkbox>
            {/* <span></span> */}
            <Button type="primary" danger onClick={() => onChange('delete')}>删除</Button>
        </div>
    )
};

export default Item;


